<script setup>
import { ref } from "vue";
import { useRoute, useRouter } from "vue-router";
import { getSearchList } from "../../apis/music";
import { createWindow } from "../../utils/ipcRenderer";
const props = defineProps(['singerList'])

//跳转至歌手详情
const handleSinger = (id) => {
  createWindow({
    windowName: "singerDetail",
    path: "singerDetail",
    width: 1200,
    height: 820,
    param: { id: id },
  });
};
</script>

<template>
  <div v-if="singerList" class="singer_wrap">
    <div
      v-for="(item, index) in singerList"
      :key="index"
      class="item"
    >
      <div class="cover">
        <el-image
          lazy
          @click="handleSinger(item.id)"
          :src="item.img1v1Url+`${'?param=300y300'}}`"
          fit="cover"
        ></el-image>
      </div>
      <div class="name">{{ item.name }}</div>
    </div>
  </div>
</template>

<style scoped lang="scss">
.singer_wrap {
  margin-top: 20px;
  width: 100%;
  height: 100%;
  display: grid;
  justify-content: space-around;
  grid-template-columns: repeat(auto-fill, 12vw);
  .item {
    .cover {
      width: 11vw;
      height: 11vw;
      .el-image {
        width: 100%;
        height: 100%;
        border-radius: 50%;
      }
    }
    .name {
      text-align: center;
      font-size: 18px;
      font-weight: 600;
      margin-top: 10px;
    }
  }
}
</style>
